Skip to content

Conversation

@eeckstein
Copy link
Contributor

Although this error can only happen when tinkering with the stdlib's runtime functions, it's nice to get a readable error message. So far, the compiler just crashed later without a hint to the original problem.

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't insist on a test case since I'm assuming it's too much of a pain in the ass, but if it's at all possible...

(StringRef, Type, Type))

ERROR(deserialize_function_linkage_mismatch,Fatal,
"linkage mismatch of function '%0', declared as %1but expected as %2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want to add a space between then %1 and but

static StringRef getLinkageString(SILLinkage linkage) {
StringRef swift::getLinkageString(SILLinkage linkage) {
switch (linkage) {
case SILLinkage::Public: return "public ";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I see, this already has a space at the end, but that's really weird, can you please change it to not do that? There is only one caller of getLinkageString(), and it's printLinkage(), which could easily be changed to print the space.

@rauhul
Copy link
Member

rauhul commented Nov 21, 2025

Thanks for improving this erik! :D

… diagnostic

Although this error can only happen when tinkering with the stdlib's runtime functions, it's nice to get a readable error message. So far, the compiler just crashed later without a hint to the original problem.
@eeckstein eeckstein force-pushed the linkage-mismatch-error branch from c2545ad to 9d02917 Compare November 21, 2025 10:47
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@slavapestov
Copy link
Contributor

Thank you for addressing the review feedback! LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants